package stark.app.frame.baseclassuse;

import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import stark.app.MainBaseFragment;
import stark.app.frame.TextItemBean;
import stark.common.basic.adapter.BaseLoadMoreAdapter;

public class BaseClassUseFragment extends MainBaseFragment {

    @Override
    public void addDefaultData() {
        mAdapter.addData(new TextItemBean("加载更多Adapter-" + BaseLoadMoreAdapter.class.getSimpleName()
                , LoadMoreAdapterUseFragment.class));
    }

    @Override
    public void onItemClick(@NonNull BaseQuickAdapter<?, ?> adapter, @NonNull View view, int position) {
        Class<?> clazz = mAdapter.getItem(position).getDestCls();
        if (clazz != null) {
            BaseClassUseDemoActivity.start(getActivity(), BaseClassUseDemoActivity.class,
                    (Class<? extends Fragment>) clazz);
        }
    }

}